<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>注册1号店</title>
<link href="<?php echo __PUBLIC__ ?>/css/register.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo __PUBLIC__ ?>/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<?php echo __PUBLIC__ ?>/js/checkpost.js"></script>
<script type="text/javascript">
    
    // var APP=<?php echo __APP__ ?>;
</script>
<style type="text/css">

    .yanzheng{
        position:absolute;
        left:340px;
        top:14px;
        height:20px;
        width:200px;
        margin-left:30px;
        color:red;
    }

    #code_right{
        position:absolute;
        left:145px;
        top:14px;
        font-size:25px;
        color:red;
    }
    .form_eroory{
        background:red;
    }

</style>
<script type="text/javascript">
        $(function(){
            var imgSrc = $('#img').attr('src');
            //点击图片切换验证码
            $('#img').click(function(){
                //改变图片地址,原来地址加随机数
                $(this).attr('src', imgSrc + '&rand=' + Math.random());
            })
            //点击文字切换验证码
            $('#click-a').click(function(){
                //改变图片地址
                $('#img').attr('src', imgSrc + '&rand=' + Math.random());
            })
            
        })
    </script>
</head>

<body>
	          
<?php  include  APP_PUBLIC_PATH .'/head2.html' ?>
<div class="regist_wrap">
    <div class="mod_regist_wrap">
    
    	<div class="regist_border clearfix">
        	<div class=" regist_left">
        	<input name="returnUrl" value="" id="returnUrl" type="hidden">
        	<input name="activities" value="0" id="activities" type="hidden">
        	<input id="lockEmail" name="lockEmail" value="0" type="hidden">
              
                <form action="" name='myform' method="post" onsubmit='return CheckPost()'>
                <div class="regist_form">
                    <ul class="clearfix">
                        <li>
                            <div class="form_item">
                                <label>用户名：</label>
                                <input class="ipt gay_text ipt_username" value="" id="email" name="username" autocomplete="off" maxlength="100" onkeyup="" onblur="" onfocus=""  type="text">
                            </div>
                            <div class="yanzheng_error yanzheng"  >
                               	 
                            </div>
                                <div class="tips_box regist_tips_error" id="email_error">
                            </div>
                            <div class="tips_box username_ok" id="email_desc"></div>
                        </li>
                        <li>
                            <div class="form_item">
                                <label>设置密码：</label>
                                <input class="ipt gay_text" id="password" name="password"  type="password" >
                            </div>
                            <div class="yanzheng pwd_error">
                                
                            </div>
                        </li>
                        <li>
                            <div class="form_item">
                                <label>确认密码：</label>
                                <input class="ipt gay_text" name="repassword"  type="password" id="conpassword">
                            	<div class="yanzheng conpassword_error">
                                    
                            	</div>
								
                            </div>
                        </li>
                        <li class="verify_code cur_right">
                            <div class="form_item form_eroory">
                                <label>验证码：</label>
                                <input class="ipt ipt_code gay_text" id="validCode" name="code" onblur="" onkeydown="" maxlength="4" onchange="" type="text">
                                <span id="code_right" style="display:none">×</span>
                                
                            </div>
                            <span class="verify_code_box"><img src="<?php echo __APP__ ?>?c=user&a=code" name="valid_code_pic"  id='img' ></span>
                            <i class="change_code" ><a href="javascript:;" id="click-a">换一张</a></i>
                        </li>
                        <li class="service_agreement">
                            <a href="#" class="check_agreement">我已阅读并同意 </a><a href="" class="blue_link" target="_blank">1号店服务协议</a>》
                            <div class="tips_box agreement_tips">
                                <u></u><p></p>
                            </div>
                        </li>
                        <li class="regist_btn">
                          <!--   <button id="email_btn" type="submit" onclick="return false;">注册</button> -->
                           <input type="submit" id="email_btn" value="注册">
                            
                        </li>
                    </ul>
                </div>
                </form>
              
        </div>
    
	</div>
</div>

	<div id="simplefooter"><a href="http://www.miibeian.gov.cn/" target="_blank">沪ICP备13044278号</a>|<a>合字B1.B2-20130004</a>|<a href="http://d7.yihaodianimg.com/N01/M04/14/0D/CgQCr1KgLjGAM5w3AAQiJTyDkdw48000.jpg" data-ref="YHD_Footer_Licence" target="_blank">营业执照</a><p>Copyright © 1号店网上超市 2007-2014，All Rights Reserved</p></div><div>

<span style="color: #FFFFFF">1226242</span>
</div>   
<script type="text/javascript">
    //声明变量
    ifemail = false;
    ifpwd = false;
    ifpwds = false;
    ifvode = false;


    console.log($(".yanzheng_error").html());

    //邮箱验证
    $("#email").click(function(){
        if($(this).val() == ''){
            $(this).val('');
        }
        $(".yanzheng_error").html('');
        $(".yanzheng_error").css('color','#ddd');
    });

    $('input[name=username]').blur(function(){
        
      
          var username=$(this).val();
        $.ajax({

           type:"post",
           url:  "<?php echo __APP__ ?>"+"?c=User&a=checkuser",
           data:{username:username},
           success:function(phpdata){
           if(phpdata=='1'){

            $('.yanzheng_error').html('该用户已被注册');
              $(".yanzheng_error").css('color','red');
           }else{ 
             $('.yanzheng_error').html('');
             

           }

           }


          });

    });


    // 密码验证
    $("#password").click(function(){
        $(".pwd_error").html('请输入6到20位有效字符!');
        $(".pwd_error").css('color','#ddd');
    });
    $("#password").blur(function(){
        if($(this).val() == ''){
            $(".pwd_error").html('密码不能为空!');
            $(".pwd_error").css('color','red');
            ifpwd = false;
        }else{
            if($(this).val().length >= 6){
                $(".pwd_error").html('正确！');
                $(".pwd_error").css('color','green');
                ifpwd = true;
            }else if($(this).val() == ''){
                $(".pwd_error").html('');
                ifpwd = false;
            }else{
                $(".pwd_error").html('密码填写不正确!');
                $(".pwd_error").css('color','red');
                ifpwd = false;
            }
            
        }
    });
    //重复密码验证
    $("#conpassword").click(function(){
        $(".conpassword_error").html('重复密码！');
        $(".conpassword_error").css('color','#ddd');
    });
    $("#conpassword").blur(function(){
        if($(this).val() == ''){
            $(".conpassword_error").html('不能为空!');
            $(".conpassword_error").css('color','red');
            ifpwds = false;
        }else if($("#password").val() == $(this).val()){
                $(".conpassword_error").html('正确！');
                $(".conpassword_error").css('color','green');
                ifpwds = true;
        }else{
            $(".conpassword_error").html('两次密码不一致！');
            $(".conpassword_error").css('color','red');
            ifpwds = false;
        }
    });


    //验证码验证
    $("#validCode").click(function(){
        $("#code_right").html();
    });
    
   
   
    
</script>
</body></html>